import {
    list,
    saveAppUp,
    enabledControl,
    getNewDownload
} from '@/services/appUp/appUpService';

export default {
    namespace: 'appUpModel',

    state: {},

    effects: {
        *list({payload, callback}, {call, put}) {
            const response = yield call(list, payload);
            if (callback) callback(response);
        },
        *saveAppUp({payload, callback}, {call, put}) {
            const response = yield call(saveAppUp, payload);
            if (callback) callback(response);
        },
        *enabledControl({ payload, callback }, { call, put }) {
            const response = yield call(enabledControl, payload);
            if(callback) callback(response);
        },
        *getNewDownload({ payload, callback }, { call, put }) {
            const response = yield call(getNewDownload, payload);
            if(callback) callback(response);
        }
    },

    reducers: {},
};
